Skip to content

Conversation

@lunny
Copy link
Member

@lunny lunny commented Jan 27, 2026

No description provided.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 27, 2026
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Jan 27, 2026
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jan 27, 2026
@lunny lunny marked this pull request as draft January 27, 2026 21:20
@lunny lunny changed the title Fix bug to check whether user can merge Fix bug to check whether user can update pull request branch or rebase branch Jan 28, 2026
@lunny lunny marked this pull request as ready for review January 28, 2026 03:59
}

// 3. check whether user has write access to head branch
// 3. check whether user has write access to base branch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment is not right

Copy link
Contributor

@wxiaoguang wxiaoguang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test is not complete, there will be regressions.

  1. You need to assert that "user can push" before the branch protection. Otherwise, any readers use also pass the tests.
  2. pushAllowed = pushAllowed || mergeAllowedMaintainer means "allow maintainer edit" can by pass the branch protection?
    • if yes, clearly test the behavior
    • if no, fix the bug
  3. The test code just duplicates with TestAPIPullUpdateByRebase2.
    • TestAPIPullUpdateByRebase2 can be deleted, and carefully test the function in unit test

@GiteaBot GiteaBot added lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/v1.25 lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged modifies/go Pull requests that update Go code type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants